{% extends 'Layout.html' %}
{% load static %}
{% block css %}
    <link rel="stylesheet" href="\static\css\bootstrap-datepicker.min.css">
{% endblock %}
{% block content %}
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">新建用户</h3>
            </div>
            <div class="panel-body">
            <form method="post" >
                {% csrf_token %}
                <div class="form-group">
                    <label >姓名</label>
                    <input type="text" class="form-control"  placeholder="姓名" name="name">
                </div>
                <div class="form-group">
                    <label >密码</label>
                    <input type="text" class="form-control"  placeholder="password" name="pwd">
                </div>
                <div class="form-group">
                    <label >年龄</label>
                    <input type="text" class="form-control"  placeholder="age" name="age">

                </div>
                <div class="form-group">
                    <label >gender</label>
                    <select class="form-control"name="gender">
                        {% for gender in gender_choices %}
                        <option value="{{ gender.0}}">{{ gender.1 }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <label >住址</label>
                    <input type="text" class="form-control"  placeholder="住址" name="address">
                </div>
                <div class="form-group">
                    <label >薪资</label>
                    <input type="text" class="form-control"  placeholder="salary" name="salary">
                </div>
                <div class="form-group">
                    <label >入职日期</label>
                    <input id="dt" autocomplete="false" type="text" class="form-control"  placeholder="入职日期" name="create_time">
                </div>
                <div class="form-group">
                    <label >所在部门</label>
                   <select class="form-control" name="depart_name">
                       {% for item in depart_list %}
                        <option value={{ item.id }}>{{ item.title }}</option>
                       {% endfor %}
                    </select>
                </div>

                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </div>
        </div>
    </div>
{% endblock %}
{% block js %}
    <script src="\static\js\bootstrap-datepicker.min.js"></script>
    <script src="\static\js\bootstrap-datepicker.zh-CN.min.js"></script>
    <script>
    $(function() {
        $("#dt").datepicker({
            format:'yyyy-mm-dd',
            startDate:'0',
            language:"zh-CN",
            autoclose:true
        });
    })
    </script>
{% endblock %}